<!DOCTYPE html>
<?php
    session_start();
?>
<html lang="es" xml:lang="es">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Panel Administrador</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/jquery.dataTables.min.css" rel="stylesheet">
    <link href="font-awesome/css/font-awesome.css" rel="stylesheet">
    <link href="css/plugins/timeline/timeline.css" rel="stylesheet">
    <link href="css/sb-admin.css" rel="stylesheet">
</head>
<body>
    <div id="wrapper">
        <nav class="navbar navbar-static-top navbar-inverse" role="navigation" style="margin-bottom: 0">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="main.php">Panel Administrador</a>
            </div>
            <ul class="nav navbar-top-links navbar-right">
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <i class="fa fa-envelope fa-fw"></i>  <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-messages">
                        <li>
                            <a href="#">
                                <div>
                                    <strong>John Smith</strong>
                                    <span class="pull-right text-muted">
                                        <em>Yesterday</em>
                                    </span>
                                </div>
                                <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...</div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <strong>John Smith</strong>
                                    <span class="pull-right text-muted">
                                        <em>Yesterday</em>
                                    </span>
                                </div>
                                <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...</div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <strong>John Smith</strong>
                                    <span class="pull-right text-muted">
                                        <em>Yesterday</em>
                                    </span>
                                </div>
                                <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...</div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a class="text-center" href="#">
                                <strong>Read All Messages</strong>
                                <i class="fa fa-angle-right"></i>
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <i class="fa fa-bell fa-fw"></i>  <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-alerts">
                        <li>
                            <a href="#">
                                <div>
                                    <i class="fa fa-comment fa-fw"></i> New Comment
                                    <span class="pull-right text-muted small">4 minutes ago</span>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <i class="fa fa-twitter fa-fw"></i> 3 New Followers
                                    <span class="pull-right text-muted small">12 minutes ago</span>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <i class="fa fa-envelope fa-fw"></i> Message Sent
                                    <span class="pull-right text-muted small">4 minutes ago</span>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <i class="fa fa-tasks fa-fw"></i> New Task
                                    <span class="pull-right text-muted small">4 minutes ago</span>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <i class="fa fa-upload fa-fw"></i> Server Rebooted
                                    <span class="pull-right text-muted small">4 minutes ago</span>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a class="text-center" href="#">
                                <strong>See All Alerts</strong>
                                <i class="fa fa-angle-right"></i>
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <i class="fa fa-user fa-fw"></i>  <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-user">
                        <li><a id="perfil" href="perfil.php"><i class="fa fa-user fa-fw"></i> Perfil</a>
                        </li>
                        <li><a href="#"><i class="fa fa-gear fa-fw"></i> Configuraci&oacute;n</a>
                        </li>
                        <li class="divider"></li>
                        <li><a href="logout.php"><i class="fa fa-sign-out fa-fw"></i> Salir</a>
                        </li>
                    </ul>
                </li>
            </ul>
        </nav>
        <nav class="navbar-default navbar-static-side" role="navigation" id="nav">
            <div class="sidebar-collapse" id="content">
                <ul class="nav" id="side-menu">
                    <li>
                        <a href="#"></i>SIGEC</a>
                    </li>
                    <li id="menu_asignaturas">
                        <a href="#"></i>Asignaturas<span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li>
                                <a class="escribir" id="agregar_asignaturas" href="#">Agregar</a>
                            </li>
                            <li>
                                <a id="gestionar_asignaturas" href="#">Actualizar</a>
                            </li>
                        </ul>
                    </li>
                    <li id="menu_centros">
                        <a href="#"></i>Centros de Investigación<span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li>
                                <a class="escribir" id="agregar_centro" href="#">Agregar</a>
                            </li>
                            <li>
                                <a id="gestionar_centro" href="#">Actualizar</a>
                            </li>
                        </ul>
                    </li>
                    <li id="menu_personal">
                        <a href="#"></i>Personal<span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li>
                                <li>
                                    <a class="escribir" id="agregar_personal" href="#">Agregar</a>
                                </li>
                            </li>
                            <li>
                                <a id="gestionar_personal" href="#">Actualizar</a>
                            </li>
                        </ul>
                    </li>
                    <li id="menu_rol">
                        <a href="#"></i>Roles<span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li>
                                <a class="escribir" id="agregar_rol" href="#">Agregar</a>
                            </li>
                            <li>
                                <a id="gestionar_rol" href="#">Actualizar</a>
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>
        </nav>
        <div id="page-wrapper">
            <div class="row">
                <div class="col-xs-12"><br/></div>
            </div>
            <div id="mensajito_exito" class="alert alert-success alert-dismissable" style="display: none;">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                Se ha agregado correctamente el registro!
            </div>
            <div id="mensajito_error" class="alert alert-danger alert-dismissable" style="display: none;">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                Ha ocurrido un error! No se pudo agregar el registro.
            </div>
            <div id = "caja" class="row" style="clear:both;">
                <div class="col-xs-12">
                    <h1>¡Hola <?php echo $_SESSION['nombre'];?>!</h1>
                    <h1>Bienvenido al m&oacute;dulo de administraci&oacute;n de SIGEC</h1>
                    <h3>Empiece seleccionando la acci&oacute;n que desee realizar en el men&uacute; izquierdo</h3>
                    <h3><span class="glyphicon glyphicon-hand-left"/></h3>
                </div>
            </div>
        </div>
        <div class = "col-xs-12"></br></br></div>
    
        <nav class="navbar navbar-fixed-bottom navbar-default" role="navigation" >
                                <div class="navbar-header pull-left">
                                        <a href="http://www.ucv.ve" title="Universidad Central de Venezuela"><img src="img/ucv.png" style="margin-left: 15px" width="60" height="60" border="0"></a>
                                        <a href="http://www.ciens.ucv.ve/ciens/" title="Facultad de Ciencias"><img src="img/Facultadciencias.png" style="margin-left: 5px" width="60" height="60"></a>
                                        <a href="http://www.ciens.ucv.ve/escueladecomputacion/inicio/index" title="Escuela de Computaci&oacute;n"><img src="img/logo_computacion.png" style="margin-left: 5px" width="60" height="60"></a>
                                </div>
                <div class="navbar-header  pull-right ">
                    <p class="navbar-text" style="margin-top: 15%" href="#">@ Ibis Development 2014</p>
                </div>
        </nav>
    </div>

    <script src="js/jquery-1.11.0.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script>
    <script src="js/jquery.dataTables.min.js"></script>
    <script src="js/jquery.validate.min.js"></script>
    <script src="js/sb-admin.js"></script>

    <script type="text/javascript">

        $("#agregar_personal").click(function(){$.ajax({type:"POST",url:"agregar_persona.html",success:function(result){$("#caja").html(result);}});});
        $("#agregar_asignaturas").click(function(){$.ajax({type:"POST",url:"agregar_asignatura.html",success:function(result){$("#caja").html(result);}});});
        $("#agregar_rol").click(function(){$.ajax({type:"POST",url:"agregar_rol.html",success:function(result){$("#caja").html(result);}});});
        $("#agregar_centro").click(function(){$.ajax({type:"POST",url:"agregar_centro.html",success:function(result){$("#caja").html(result);}});});

        $("#gestionar_asignaturas").click(function(){$.ajax({type:"POST",url:"gestionar_asignaturas.php",success:function(result){$("#caja").html(result);}});});
        $("#gestionar_personal").click(function(){$.ajax({type:"POST",url:"gestionar_personal.php",success:function(result){$("#caja").html(result);}});});
        $("#gestionar_rol").click(function(){$.ajax({type:"POST",url:"gestionar_rol.php",success:function(result){$("#caja").html(result);}});});
        $("#gestionar_centro").click(function(){$.ajax({type:"POST",url:"gestionar_centro.php",success:function(result){$("#caja").html(result);}});});
                
        <?php  if(isset($_GET["exito"])&&$_GET["exito"]=="1"){?>
            $("#mensajito_exito").show();
        <?php  }?>
        <?php  if(isset($_GET["exito"])&&$_GET["exito"]=="0"){?>
            $("#mensajito_error").show();
        <?php  }?>

        <?php  if(isset($_SESSION['escribir'])&&$_SESSION['escribir']=="N"){?>
            $(".escribir").hide();
        <?php  }?>

        setTimeout(function() {
            $('#mensajito_exito').fadeOut('slow');
            $('#mensajito_error').fadeOut('slow');
        }, 2000);
        
        <?php  if(isset($_GET["goto"])&&$_GET["goto"]=="agregar_asignaturas"){?>
            $("#agregar_asignaturas").trigger('click');
            $("#menu_asignaturas").addClass("active");
        <?php  }?>
        <?php  if(isset($_GET["goto"])&&$_GET["goto"]=="agregar_centro"){?>
            $("#agregar_centro").trigger('click');
            $("#menu_centros").addClass("active");;
        <?php  }?>
        <?php  if(isset($_GET["goto"])&&$_GET["goto"]=="agregar_personal"){?>
            $("#agregar_personal").trigger('click');
            $("#menu_personal").addClass("active");
        <?php  }?>
        <?php  if(isset($_GET["goto"])&&$_GET["goto"]=="agregar_rol"){?>
            $("#agregar_rol").trigger('click');
            $("#menu_rol").addClass("active");
        <?php  }?>

        <?php  if(isset($_GET["goto"])&&$_GET["goto"]=="gestionar_asignaturas"){?>
            $("#gestionar_asignaturas").trigger('click');
            $("#menu_asignaturas").addClass("active");
        <?php  }?>
        <?php  if(isset($_GET["goto"])&&$_GET["goto"]=="gestionar_centro"){?>
            $("#gestionar_centro").trigger('click');
            $("#menu_centros").addClass("active");
        <?php  }?>
        <?php  if(isset($_GET["goto"])&&$_GET["goto"]=="gestionar_personal"){?>
            $("#gestionar_personal").trigger('click');
            $("#menu_personal").addClass("active");
        <?php  }?>
        <?php  if(isset($_GET["goto"])&&$_GET["goto"]=="gestionar_rol"){?>
            $("#gestionar_rol").trigger('click');
            $("#menu_rol").addClass("active");
        <?php  }?>

        <?php  if(isset($_GET["goto"])&&$_GET["goto"]=="agregar_profesor"){?>
            $("#caja").load('agregar_profesor.html');
        <?php  }?>
        <?php  if(isset($_GET["goto"])&&$_GET["goto"]=="agregar_personal"){?>
            $("#caja").load('agregar_personal.php?'+$_GET['ci']);
        <?php  }?>
        <?php  if(isset($_GET["goto"])&&$_GET["goto"]=="agregar_estudiante"){?>
            $("#caja").load('agregar_estudiante.html');
        <?php  }?>

    </script>
</body>
</html>